package com.chen.im.view;



import com.chen.boot.db.entity.ContactsInfo;

import org.apache.commons.lang3.StringUtils;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.text.Text;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description
 * @Author Pengwei
 * @CreatDate 2021/11/15 01:35
 */
@Data
@Accessors(chain = true)
public class ContactstListItem {

    ContactsInfo data;
    String uuid;

    @FXML
    ImageView imageView;
    @FXML
    Label contactsName;
    @FXML
    Label contactsIP;
    @FXML
    Label lastMsg;

    @FXML
    public void initialize() {
    }

    public ContactstListItem setData(ContactsInfo contactsInfo) {
        String name = contactsInfo.getName();
        if (StringUtils.isNotBlank(contactsInfo.getAlias())) {
            name = contactsInfo.getAlias();
        }
        contactsName.setText(name);
        contactsIP.setText(contactsInfo.getIp());
        lastMsg.setText("消息无最最后消息消息无最最后消息消息无最最后消息消息无最最后消息消息无最最后消息消息无最最后消息");
        return this;
    }
}
